package org.wisdom.cc.domain.entity;

import lombok.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.core.annotation.Order;
import org.wisdom.data.jpa.entity.BaseEntity;

import javax.persistence.*;
import java.util.List;

/**
 * 数据字典类型
 *
 * @author 张智研
 * @date 2022/10/12 14:09
 **/
@EqualsAndHashCode(callSuper = true)
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@Slf4j
public class CcDictType extends BaseEntity {

    /** 字典名称 */
    @Order(1)
    private String dictName;

    /** 字典类型 */
    @Order(2)
    private String dictType;

    /** 状态（0正常 1停用） */
    @Order(3)
    private String status;

    /** 字典数据 */
    @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true)
    @JoinColumn(name = "dictType")
    @Order(4)
    private List<CcDictData> dictDataList;
}
